import pandas as pd
list_nodes = [
    {'name':'贾母','category':'第一代'},
    {'name':'贾赦','category':'第二代'},
    {'name':'贾政','category':'第二代'},
    {'name':'王夫人','category':'第二代'},
    {'name':'邢夫人','category':'第二代'},
    {'name':'贾宝玉','category':'第三代'},
    {'name':'林黛玉','category':'第三代'},
    {'name':'薛宝钗','category':'第三代'}
]
list_links = [
    {'source':'贾母','target':'贾赦','value':'母子'},
    {'source':'贾母','target':'贾政','value':'母子'},
    {'source':'贾母','target':'贾宝玉','value':'祖孙'},
    {'source':'贾母','target':'林黛玉','value':'外祖孙'},
    {'source':'贾政','target':'王夫人','value':'夫妻'},
    {'source':'贾赦','target':'邢夫人','value':'夫妻'},
    {'source':'贾赦','target':'贾政','value':'兄弟'},
    {'source':'贾政','target':'贾宝玉','value':'父子'},
    {'source':'贾政','target':'林黛玉','value':'舅甥'},
    {'source':'贾赦','target':'林黛玉','value':'舅甥'},
    {'source':'王夫人','target':'薛宝钗','value':'姨甥'},
    {'source':'邢夫人','target':'王夫人','value':'妯娌'},
    {'source':'王夫人','target':'贾宝玉','value':'母子'},
    {'source':'贾宝玉','target':'林黛玉','value':'表兄妹'},
    {'source':'薛宝钗','target':'贾宝玉','value':'表姐弟'}
]
list_categorys = [
    {'name':'第一代','symbolSize':50},
    {'name':'第二代','symbolSize':40},
    {'name':'第三代','symbolSize':30}
]
df1=pd.DataFrame(list_nodes)
df2=pd.DataFrame(list_links)
df3=pd.DataFrame(list_categorys)
dfs=[df1,df2,df3]
with pd.ExcelWriter('红楼梦部分人物关系.xlsx') as writer:
    df1.to_excel(writer,sheet_name='sheet1',index=False)
    df2.to_excel(writer, sheet_name='sheet2', index=False)
    df3.to_excel(writer, sheet_name='sheet3', index=False)